package com.zsix.system.strategy.doEvent;

import com.zsix.system.strategy.manager.DoEventManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;

@Component
public class AfterReturn implements DoEventStrategy {
    @Autowired
    private DoEventManager doEventManager;
    /**
     * 执行提退回之后事件
     * @param proc_inst_id
     * @param businessKey
     * @param doDoc
     * @return
     */
    public Boolean Do(String doEventWay,String proc_inst_id,String businessKey,String doDoc,String linkId){
        HashMap<String,Object> hashMap=doEventManager.EvenParams(businessKey,proc_inst_id);
        if(doDoc.contains("@businessKey"))
            doDoc=doDoc.replace("@businessKey",businessKey);
        if(doDoc.contains("@linkKey"))
            doDoc=doDoc.replace("@linkKey",linkId);
        return doEventManager.DoEventByWay(doEventWay,doDoc,hashMap);
    }
    /**
     * 返回服务类型
     * @return
     */
    @Override
    public int getType(){
        return 4;
    }
}
